Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factory: handle properly snapd_recovery_mode based on modeenv value #214

Closed
wants to merge 1 commit into from

Conversation

kubiko
Copy link

@kubiko kubiko commented Oct 10, 2023

The real source of true for the current mode is stored in /var/lib/snapd/modeenv this value might be altered after
/usr/lib/systemd/system-generators/journald-console was already run.
Or /var/lib/snapd/modeenv did not even exist at that time.
This happens in install/factory-reset/recovery modes which might be handled within the initrd.
If this is detected, update journald-console generator and remove already created journald.conf.d/core-override.conf config overlay.

@kubiko kubiko requested a review from xnox October 10, 2023 16:49
The real source of true for the current mode is stored in /var/lib/snapd/modeenv
this value might be altered after
/usr/lib/systemd/system-generators/journald-console was already run.
Or /var/lib/snapd/modeenv did not even exist at that time.
This happens in install/factory-reset/recovery modes which might be
handled within the initrd.
If this is detected, update journald-console generator and remove
already created journald.conf.d/core-override.conf overlay.

Signed-off-by: Ondrej Kubik <[email protected]>
@kubiko
Copy link
Author

kubiko commented Oct 11, 2023

Redone as per @xnox suggestion

rm /run/systemd/journald.conf.d/core-override.conf
cmdline_mode="$(/usr/libexec/core/get-arg snapd_recovery_mode)
sed -i 's/snapd_recovery_mode=run/snapd_recovery_mode='"${cmdline_mode}"'/g' /usr/lib/systemd/system-generators/journald-console
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this hunk still needed, given the improved generator? cause in core22 pull request it is now not needed, or am i missing some other core20 vs core22 differences?

@alfonsosanchezbeato
Copy link
Member

See comment in #213

@xnox
Copy link
Contributor

xnox commented Oct 15, 2023

Newer series must be merged first.

@xnox xnox closed this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants